#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
      // 提示说明
//    ui->pushButton->setToolTip("这是按钮1");
//    ui->pushButton->setToolTipDuration(3000);
//    ui->pushButton_2->setToolTip("这是按钮2");
//    ui->pushButton_2->setToolTipDuration(5000);


      // 焦点
//    ui->lineEdit->setFocusPolicy(Qt::ClickFocus);
//    ui->lineEdit_2->setFocusPolicy(Qt::TabFocus);
//    ui->lineEdit_3->setFocusPolicy(Qt::StrongFocus);
//    ui->lineEdit_4->setFocusPolicy(Qt::StrongFocus);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_light_clicked()
{
    this->setStyleSheet("background-color : rgb(240, 240, 240);");
    // color：设置字体的颜色
    ui->textBrowser->setStyleSheet("background-color : rgb(255, 255, 255); color : rgb(0,0,0)");
    ui->pushButton_light->setStyleSheet("color:#000;");
    ui->pushButton_dark->setStyleSheet("color:#000;");
}

void Widget::on_pushButton_dark_clicked()
{
    this->setStyleSheet("background-color : rgb(0,0,0);");
    // color：设置字体的颜色
    ui->textBrowser->setStyleSheet("background-color : rgb(0,0,0); color : rgb(255, 255, 255)");
    ui->pushButton_light->setStyleSheet("color:#ffffff;");
    ui->pushButton_dark->setStyleSheet("color:#ffffff;");
}
